cmake_minimum_required(VERSION 3.14)

include(cmake/SparkWithGit.cmake)
spark_include(SparkCMakeInfoBeforeConfig.cmake)

project(opencv-camera LANGUAGES CXX VERSION 0.0.1)

spark_initialize_modules()

# 资源文件路径
set(QRC_SOURCES "")

##
# [Desktop Entry] For Linux 
# 内容默认应用名称: Name= 应与项目名称相同
spark_desktop_macros(
    # 应用名称: Name=
    "Opencv Camera"
    # 应用名称: Name[zh_CN]=
    "迷你 Opencv 摄像头"
    # 应用说明: Comment=
    "基于 PySide6 的 Camera 工具"
    # 应用类型: Type=
    "Application"
    # 执行程序: Exec=
    "/opt/apps/com.gitee.zinface.opencv-camera/camera"
    # 图标路径: Icon=
    "com.gitee.zinface.opencv-camera"
    # 应用分类: Categories=
    "Utility"
    # MIME类型: MimeType=
)
install(FILES ${SPARK_DESKTOP_FILE}
    DESTINATION /usr/share/applications
    RENAME com.gitee.zinface.opencv-camera.desktop
)
install(DIRECTORY dist/camera/_internal
    DESTINATION /opt/apps/com.gitee.zinface.opencv-camera
)
install(PROGRAMS dist/camera/camera
    DESTINATION /opt/apps/com.gitee.zinface.opencv-camera
)
install(FILES
    extension_icon.png
    DESTINATION /usr/share/icons/hicolor/512x512/apps
    RENAME com.gitee.zinface.opencv-camera.png
)

##
# [deb] For Linux(with dpkg)
# 注释行(使用方式)
add_package_descript(cmake/spark-deb-package.descript)